import request from '@/utils/request'
import operator from '../views/operator/index.vue'

export default {
  getList(currentPage, pageSize, operatorDTO) {
    return request({
      // 请求的地址
      url: `/operator/list/${currentPage}/${pageSize}`,
      // 请求的方式
      method: 'post',
      // 请求的数据 post请求发送数据时使用data  get请求发送数据时使用 params
      data: operatorDTO
    })
  },
  getById(id) {
    return request({
      url: `/operator/${id}`,
      method: 'get'
    })
  },
  edit(operator) {
    return request({
      url: `/operator/edit/`,
      method: 'put',
      data: operator
    })
  },
  save(operator) {
    return request({
      url: `/operator/save`,
      method: 'post',
      data: operator
    })
  },
  forbidden(id) {
    return request({
      url: `/operator/forbidden/${id}`,
      method: 'put'
    })
  },
  recover(id) {
    return request({
      url: `/operator/recover/${id}`,
      method: 'put'
      })
  },
  delete(id) {
    return request({
      url: `/operator/delete/${id}`,
      method: 'delete'
    })
  }
}

